package com.ethan.blog.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                // 接口文档标题
                .info(new Info().title("EthanBlog API")
                        // 开发者联系方式
                        .contact(new Contact()
                                .name("ZP")
                                .email("2212853191@qq.com"))
                        // 接口文档简介
                        .description("个人博客API文档")
                        // 接口文档版本号
                        .version("v1")
                        .license(new License().name("Apache 2.0").url("http://springdoc.org")))
                .externalDocs(new ExternalDocumentation()
                        .description("项目地址")
                        .url("https://gitee.com/gitee_Ehan_admin/ethan-blog"));
    }
}


